<?php

class NCore_ActionPipe extends NCore_Pipe
{
	protected $actions = array();
	
	public function __construct($name)
	{
		parent::__construct($name);
		$this->getView('default')
			->withMarkup('');	
		$this->getView('empty')
			->withMarkup('');
			
		$this->withSelectedView('default');
	}
	public function addAction($action)
	{
		$this->actions[] = $action;
		return $this;
	}
	public function getActions()
	{
		return $this->actions;
	}

    public function withNestedPipe($pipeName)
    {
        throw new Exception('Because nested pipes are used only for complex presentation, they cannot be used with objects of type NCore_ActionPipe');
    }

    public function isNestedPipe($bool = NULL)
    {
        if (is_null($bool))
        {
            return $this->isNestedPipe;
        }
        else
        {
            if (!is_boolean($bool))
                throw new Exception('isNestedPipe() only accepts boolean values.');

            throw new Exception('Action pipes cannot have their isNestedPipe value altered, as they cannot serve as nested pipes.');
        }
    }
}

?>